<template>
  <div id="menu-list">
    <div class="logo tc">
      <div class="logo-content">
        infosun太信
      </div>
    </div>
    <div class="list">
      <el-menu :default-active="acTiveMenu" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" :unique-opened="true" :router="true">
        <!-- <el-menu-item index="roleManagement">
        <span slot="title">工单报表</span>
      </el-menu-item> -->
        <el-menu-item index="workOrderSearch" v-if="getPermissionControl.workOrderSearch">
          <span slot="title">工单查询</span>
        </el-menu-item>
        <el-menu-item index="workOrderPool" v-if="getPermissionControl.workOrderPool">
          <span slot="title">工单池</span>
        </el-menu-item>
        <el-menu-item index="addUser" v-if="getPermissionControl.addUser">
          <span slot="title">增加用户</span>
        </el-menu-item>
        <el-menu-item index="userConfig" v-if="getPermissionControl.importClassification">
          <span slot="title">工单节点管理</span>
        </el-menu-item>
        <el-menu-item index="cityArea" v-if="getPermissionControl.cityArea">
          <span slot="title">省市区节点管理</span>
        </el-menu-item>
        <el-menu-item index="userList" v-if="getPermissionControl.userList">
          <span slot="title">用户列表</span>
        </el-menu-item>
        <el-menu-item index="releaseOrder" v-if="getPermissionControl.releaseOrder">
          <span slot="title">未释放工单</span>
        </el-menu-item>
        <!-- <el-menu-item>
        <span slot="title" @click="FnNewPages">排班系统</span>
      </el-menu-item> -->
        <!-- <el-menu-item index="1">
        <i class="el-icon-setting"></i>
        <span slot="title">导航四11</span>
      </el-menu-item> -->
      </el-menu>
    </div>
  </div>
</template>

<script>
import { mapActions, mapGetters } from 'vuex';
export default {
  name: '',
  data() {
    return {
      acTiveMenu: '',
      roleObj: {
        workOrder: '工单查询',//
        addUser: '增加用户',//


      }
    }
  },
  props: {

  },
  created() {
    if (this.getPermissionControl.workOrderSearch) {//工单查找
      this.acTiveMenu = 'workOrderSearch'
    } else if (this.getPermissionControl.workOrderPool) {//工单池
      this.acTiveMenu = 'workOrderPool'
    } else if (this.getPermissionControl.addUser) {//增加用户
      this.acTiveMenu = 'addUser'
    }
  },
  mounted() {
  },
  methods: {
    FnNewPages() {
      var user = window.sessionStorage.getItem("user") ? JSON.parse(window.sessionStorage.getItem("user")) : '';
      if (!user) {
        this.$message.error("请先登录");
        return
      }
      var Authorization = user.obj.token
      window.open(`http://210.21.48.76:86/#/login?Authorization=${Authorization}`)
    },
    FnMune(e) {
      window.sessionStorage.setItem('mune', e);
    },
    handleOpen(e) {
    },
    handleClose() {

    }
  },
  components: {

  },
  computed: {
    ...mapGetters(['getPermissionControl'])
  },
  watch: {
    'acTiveMenu': {
      handler: function (nv, ov) {
        this.$router.push({ name: nv })
      },
      deep: true
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang='scss' scoped>
#menu-list {
  margin: 0;
  width: 200px;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgb(62, 62, 62);
  z-index: 4;
  // padding-top: 55px;
  .logo {
    height: 80px;
    line-height: 80px;
    // background-color:blue;
    background-color: rgb(62, 62, 62) !important;
    border-radius: 2px;
    .logo-content {
      font-size: 30px;
      color: #fff;
    }
  }
  .list {
    li {
      width: 200px;
    }
    .el-submenu__title {
      background-color: rgb(62, 62, 62) !important;
      color: red;
    }
    .menu-icon {
      display: inline-block;
      width: 18px;
      height: 18px;
      vertical-align: middle;
      margin-top: 3px;
      background-color: #000;
      opacity: 0.5;
      margin-left: 2px;
    }
    .title-icon {
      font-size: 14px;
      text-align: left;
    }
    // .outbound-icon {
    //   background:url("../../img/outbound-icon.png") no-repeat;
    // }
    // .communication-icon {
    //   background:url("../../img/phone-icon.png") no-repeat;
    // }
    // .history-icon {
    //   background:url("../../img/history-icon.png") no-repeat;
    // }
    // .monitor-icon {
    //   background:url("../../img/monitor-icon.png") no-repeat;
    // }
    // .report-icon {
    //   background:url("../../img/report-icon.png") no-repeat;
    // }
    // .set-icon {
    //   background:url("../../img/set-icon.png") no-repeat;
    // }
  }
}
</style>